import { _decorator, Component, director, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('PauseBtn')
export class PauseBtn extends Component {

    @property(Node) PausePanelNode: Node = null;

    protected onLoad(): void {
        this.node.on(Node.EventType.TOUCH_START, this.onTouchStart, this);
        this.node.on(Node.EventType.TOUCH_END, this.onTouchEnd, this);
        this.node.on(Node.EventType.TOUCH_CANCEL, this.onTouchCancel, this);
    }

    start() {

    }

    update(deltaTime: number) {
    }

    onTouchStart() {
        this.node.setScale(.9, .9);
    }
    onTouchEnd() {
        this.node.setScale(1, 1);
        // 打开面板
        this.PausePanelNode.active = true;
    }
    onTouchCancel() {
        this.node.setScale(1, 1);
    }
}


